# -*- coding = utf-8 -*-
# @Time : 2024/6/8 18:12
# @Author : 0505200213石浪
# @File : app.py
# @Software : PyCharm

from flask import Flask
from extensions import socketio
from routes import bp as main_bp


def create_app():
    app = Flask(__name__)
    app.config['SECRET_KEY'] = 'your_secret_key'

    # 注册蓝图
    app.register_blueprint(main_bp)

    # 初始化SocketIO
    socketio.init_app(app)

    return app


if __name__ == '__main__':
    app = create_app()
    socketio.run(app, debug=True)
